//
//  ShoppingViewController.m
//  HaoHaiSpell
//
//  Created by haohai on 16/6/17.
//  Copyright © 2016年 海城. All rights reserved.
//

#import "ShoppingViewController.h"
#import "ShoppingListCell.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource>

<<<<<<< HEAD
@property (strong, nonatomic) LXSegmentScrollView *segementView;
@property (strong, nonatomic) UITableView *contentTableView;
=======
@property (weak, nonatomic) IBOutlet LXSegmentScrollView *segementView;
@property (weak, nonatomic) IBOutlet UITableView *contentTableView;
>>>>>>> 5bee59541ff07dbcbaa6fe419e6df24b39c5e23d
@property (nonatomic,strong)NSMutableArray *allDataArray;
@property (nonatomic,strong)NSMutableArray *titleArray;//分段控制器标题




@end

@implementation ShoppingViewController
#pragma mark - 懒加载
<<<<<<< HEAD
-(LXSegmentScrollView *)segementView{

    if (!_segementView) {
        _segementView = [[LXSegmentScrollView alloc]initWithFrame:CGRectMake(0, 64, kWidth, 50) titleArray:self.titleArray contentViewArray:nil];
    }
    return _segementView;
}

-(UITableView *)contentTableView{

    if (!_contentTableView) {
        _contentTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 114, kWidth, kHeight - 114)];
        _contentTableView.delegate = self;
        _contentTableView.dataSource = self;
    }
    return _contentTableView;
}


=======
>>>>>>> 5bee59541ff07dbcbaa6fe419e6df24b39c5e23d
-(NSMutableArray *)allDataArray{

    if (!_allDataArray) {
        _allDataArray = [NSMutableArray new];
    }
    return _allDataArray;
}

-(NSMutableArray *)titleArray{
    
    if (!_titleArray) {
        _titleArray = [NSMutableArray arrayWithArray:@[@"全部",@"母婴",@"手机",@"茶",@"海鲜",@"水果",@"蔬菜",@"美妆",@"教育",@"干货",@"宾馆",@"娱乐",@"海淘"]];
    }
    return _titleArray;
}
#pragma mark - 自定义
<<<<<<< HEAD


=======
-(void)addSegementView{

    
}

-(void)touchLabelWithIndex:(NSInteger)index{

NSLog(@"我是第%ld个label",index);
}
>>>>>>> 5bee59541ff07dbcbaa6fe419e6df24b39c5e23d

#pragma mark - 视图生命周期
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
<<<<<<< HEAD
    [self.view addSubview:self.segementView];
    [self.view addSubview:self.contentTableView];
=======
    
>>>>>>> 5bee59541ff07dbcbaa6fe419e6df24b39c5e23d
    [self.contentTableView registerNib:[UINib nibWithNibName:@"ShoppingListCell" bundle:nil] forCellReuseIdentifier:@"shoppingCell"];
    
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
#pragma mark - UITableViewDelegate,UITableViewDataSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{


    return 10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    ShoppingListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"shoppingCell" forIndexPath:indexPath];

    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return 150;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{


    NSLog(@"");
}


@end
